Disable gzip compression for float NIfTI intermediates#285
Merged
Conversation
Write intermediate float volumes as uncompressed .nii instead of .nii.gz to avoid gzip overhead on data that is read back immediately. Integer and binary masks are left compressed since they compress efficiently. - Replace fslsplit with nibabel four_to_three in split_4d (also removes a container call) - Use .nii for per-volume ANTs outputs in resampling and longitudinal transform loops - Use .nii for motion reference slice, masking float intermediates, and distortion correction float intermediates Closes #252
FSL uses FSLOUTPUTTYPE to determine the output format, ignoring the filename extension. Keep fslmaths outputs as .nii.gz since the Docker container defaults to NIFTI_GZ.
kaitj
approved these changes
Apr 9, 2026
Contributor
kaitj
left a comment
There was a problem hiding this comment.
In principle, I think I agree with this. Do we have a general idea of how much of a difference there is between the compressed and uncompressed file sizes?
Contributor
Author
|
CI reported intermediate dir size 6.3GB before and after these changes so <100MB - generally I picked non/hard compressible float array niftis so this is not surprising |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.niiinstead of.nii.gzto avoid gzip overhead on data that is read back immediatelyfslsplitwith nibabelfour_to_threeinsplit_4d(), which also removes a container callChanged intermediates
common.py:split_4d()resampling.pyvol_*_motion.nii,vol_*_template.niilongitudinal/transform.pyvol_*_template.niimotion.pyslice.niimasking.pyprobseg_transform,bold_ref_dir_corrected,ref_bold_corrected,ref_bold_corrected_brain_masked,unidistortion.pyphasediff,merged_epiTest plan
Closes #252